<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html   xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:p="http://primefaces.org/ui">
	
<f:view contentType="text/html">
<h:head>
    <title>#{msg['view.login.form.label']}</title>
    <meta content='text/html; charset=UTF-8' http-equiv='Content-Type'/>
    <h:outputStylesheet name="login-css.css" library="css"/>
</h:head>

<h:body>
    <table id="layout-table" >
        <tr>
            <td id="layout-td" >
		<h:form id="login-form" >
                    <div id="message-container" >
                        <p:messages  />			
                    </div>										
                    <div id="login-container" >
			<p:panel id="login-panel" header="#{msg['view.login.panel.header.label']}"  >
                            <p:focus />
                            <ui:param name="loginBean" value="#{shiroLoginController}" />
                            <ui:param name="localeCtl" value="#{languageSwitcher}" />
                            <h:panelGrid border="0" width="100%"  >

                            <h:panelGrid columns="2" rendered="true" >
                                <!--<h:outputText value="#{localeCtl.displayLanguage}" 
                                              title="#{localeCtl.locale}"  />-->
                                <h:selectOneMenu  title="#{localeCtl.displayLanguage}" 
                                                  value="#{localeCtl.selectedLanguage}"  >
                                    <f:selectItem itemValue="fr" itemLabel="Français"/>
                                    <f:selectItem itemValue="en" itemLabel="Anglais"  />
                                    <p:ajax id="idy" event="change" 
                                            oncomplete="javascript:location.reload(true)" />
                                </h:selectOneMenu>
                            </h:panelGrid>     
                                
                            <h:panelGrid columns="2" width="100%" columnClasses="align-l,align-r" >
				<p:outputLabel for="userlogin" value="#{msg['label.compte']}" />
				<h:outputLink  value="javascript:void(0)" onclick="dlg.show()"> #{msg['view.login.label.compte-oublie']} </h:outputLink>  									
                            </h:panelGrid>						
                            <h:panelGroup>
                                <p:inputText id="userlogin" value="#{loginBean.username}" required="true" style="width:100%" />
                                <p:watermark for="userlogin" value="#{msg['view.login.watermark.compte']}" />							
                            </h:panelGroup>
                            <p:message for="userlogin" />
                            <br/>
                            <h:panelGrid columns="2" width="100%" columnClasses="align-l,align-r"  >
                                <p:outputLabel for="userpassword" value="#{msg['label.mot-de-passe']}" />
				<h:outputLink  value="javascript:void(0)" onclick="dlg.show()">#{msg['view.login.label.mot-de-passe-oublie']}</h:outputLink>  																	
                            </h:panelGrid>													
                            <h:panelGroup>
                                <p:password id="userpassword" 	value="#{loginBean.password}"  	required="true" feedback="true" style="width:100%" />
				<p:watermark for="userpassword" value="#{msg['view.login.watermark.mot-de-passe']}"  />							
                            </h:panelGroup>
                            <p:message for="userpassword" />
                            
                            <h:panelGrid columns="2" width="100%" columnClasses="align-l,align-r"  >
                                <p:outputLabel value="#{msg['label.remember-me']}" />	
                                <p:selectBooleanCheckbox value="#{loginBean.rememberMe}" />
                            </h:panelGrid>                           
                            
                            <p:separator  />

                            <h:panelGrid columns="2" width="100%" columnClasses="align-l,align-r"  >
                                <p:commandButton value="#{msg['view.login.buton.login.label']}" action="#{loginBean.authenticate()}" update="login-form" />
				<h:outputLink  value="javascript:void(0)" onclick="dlg.show()"> #{msg['view.login.label.pas-de-compte']} </h:outputLink>  																									
                            </h:panelGrid>													
																											
                            </h:panelGrid>
                            <p:dialog  widgetVar="dlg" header="#{msg['label.aide']}" width="400"  resizable="false" showEffect="clip" hideEffect="clip"   >
				  ...
                            </p:dialog>						
			</p:panel>
                    </div>
		</h:form>						
            </td>
	</tr>
    </table>
			
</h:body>

</f:view>

</html>


